﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using TierApplication;
using TierService;

public partial class logout : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Session.RemoveAll();
        HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];

        FormsAuthentication.SignOut();
        //authCookie.Domain = "/";
        if (authCookie == null)
        {
            Response.Redirect("Login.aspx");
            Response.End();
        }
        authCookie.Expires = DateTime.Now.AddDays(-1);
        Response.Cookies.Add(authCookie);
        Response.Redirect("Login.aspx");
        Response.End();
    }
}
